package com.yl.chainStore.entity.user

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.common.annotation.NoArg
import com.yl.common.getContext

/**
 * <p>
 *      病历模板类型
 * </p>
 *
 * @author cxw
 * @since 2021-08-18
 */
@NoArg
@TableName("company_user_medical_history_model_type")
data class CompanyUserMedicalHistoryModelType(

	/**
	 * id
	 */
	@TableId(value = "id", type = IdType.AUTO)
	var id: Long,

	/**
	 * 名称
	 */
	@TableField("name")
	var name: String,

	/**
	 * 排序
	 */
	@TableField("order_num")
	var orderNum: Int = 99,

	/**
	 * 公司id
	 */
	@TableField("company_id")
	var companyId: Long = getContext().companyId,

	/**
	 * 用户id
	 */
	@TableField("user_id")
	var userId: Long = getContext().userId,

	/**
	 * 父级类型id
	 */
	@TableField("parent_id")
	var parentId:Long = 0,

	/**
	 * 子级类型列表
	 */
	@TableField(exist = false)
	var children:MutableList<CompanyUserMedicalHistoryModelType> ?= null,

	/**
	 * 模板列表
	 */
	@TableField(exist = false)
	var modelList:List<CompanyUserMedicalHistoryModel>?=null,

	/**
	 * 分院id
	 */
	@TableField("sub_company_id")
	var subCompanyId:Long = getContext().subCompanyId

	) {

}
